/**
 * @param {{command: string, args: *, key: number}} message
 * @param {WebSocket} ws
 */
const processTheMessage = async (message, ws) => {
    const opt = commandsMap[message.command];
    const result = opt ? await opt(message.args).catch(reason => Promise.resolve(typeof reason === "string" ? reason : "浏览器端异常")) : "不支持的命令";
    const returnMessage = {...message, result};
    ws.send(JSON.stringify(returnMessage));
    console.log("Message:", message, "Return", returnMessage);
};